<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>findByTitle (MywikiTest)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File test/unit/mywiki_test.rb, line 65</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">findByTitle</span>
        <span class="ruby-identifier">mywiki</span> = <span class="ruby-constant">Mywiki</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:title</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">title</span>,
                                                <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">description</span>,
                                                <span class="ruby-identifier">:body</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">body</span>,
                                                <span class="ruby-identifier">:tags</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">tags</span>,
                                                <span class="ruby-identifier">:userid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">userid</span>,
                                                <span class="ruby-identifier">:created_at</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">created_at</span>,
                                                <span class="ruby-identifier">:updated_at</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mywikis</span>(<span class="ruby-identifier">:one</span>).<span class="ruby-identifier">updated_at</span>
        <span class="ruby-identifier">assert</span> <span class="ruby-identifier">mywiki</span>.<span class="ruby-identifier">save</span>
        
        <span class="ruby-identifier">mywiki_db</span> = <span class="ruby-constant">Mywiki</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;title = '&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">mywiki</span>.<span class="ruby-identifier">title</span><span class="ruby-operator">+</span><span class="ruby-value str">&quot;'&quot;</span>)
        <span class="ruby-identifier">assert_equal</span> <span class="ruby-identifier">mywiki</span>.<span class="ruby-identifier">title</span>, <span class="ruby-identifier">mywiki_db</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">title</span>
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>